<!DOCTYPE html>
<html lang="ko">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>뮤테이션과 액션 | Vue 테스팅 핸드북</title>
    <meta name="description" content="">
    <link rel="icon" href="https://lmiller1990.github.io/vue-testing-handbook/img/favicon.png">
  <meta property="og:title" content="Vue Testing Handbook">
  <meta property="og:description" content="Vue testing handbook">
  <meta property="og:type" content="website">
  <meta property="og:url" content="https://lmiller1990.github.io/vue-testing-handbook/">
  <meta property="og:image" content="https://lmiller1990.github.io/vue-testing-handbook/img/og.png">
    
    <link rel="preload" href="/vue-testing-handbook/assets/css/0.styles.99f2ca3b.css" as="style"><link rel="preload" href="/vue-testing-handbook/assets/js/app.14051834.js" as="script"><link rel="preload" href="/vue-testing-handbook/assets/js/3.119a321e.js" as="script"><link rel="preload" href="/vue-testing-handbook/assets/js/2.94957ecd.js" as="script"><link rel="preload" href="/vue-testing-handbook/assets/js/48.840de9e5.js" as="script"><link rel="prefetch" href="/vue-testing-handbook/assets/js/10.7b1750c8.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/100.87c02eb0.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/101.9f86f8af.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/102.7cf5b3b5.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/103.9a447cc0.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/104.d960f455.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/105.42aa8c19.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/106.fa067e24.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/107.f6145328.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/108.4251a9d9.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/109.6e04b4aa.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/11.c9a15d65.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/110.203be49f.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/111.e66d4c1a.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/112.d5cf2637.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/113.0e1df8ea.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/114.b1d0a5f5.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/115.d21ab6a2.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/116.e13d34ff.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/117.532bedf9.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/118.b99c8d4d.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/119.97666be8.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/12.8ec4d737.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/120.e5fbc47b.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/121.2d6cedde.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/122.7dc3c3fc.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/123.82fcb804.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/124.affd46d3.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/125.10d1ddcb.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/126.8ca1978a.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/127.7b76e158.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/128.e0d8fdce.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/129.e861e49f.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/13.96ee585a.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/130.474092c4.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/131.71e4509c.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/132.b48fe96d.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/133.9268758a.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/134.6a042ef6.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/135.6df261f9.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/136.8aab4165.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/137.60d15690.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/138.29f827fd.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/139.e8db710e.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/14.522b77b9.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/140.8a3b2b26.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/141.cd5f96df.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/142.04a47072.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/143.ac0cb5e1.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/144.c69a73ac.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/15.2f00de2d.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/16.d120a376.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/17.9260e267.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/18.4e3a9d5e.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/19.bfe7cfa3.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/20.52828530.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/21.4d92035b.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/22.49a88bda.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/23.79de1f16.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/24.f45f108e.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/25.48371e8a.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/26.bc7a5470.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/27.49bfeced.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/28.b697055e.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/29.0ef469da.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/30.bd209efe.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/31.ddf8aa10.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/32.95ec3267.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/33.52cf0ebc.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/34.73b1ca03.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/35.be79f171.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/36.52a4dcd2.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/37.a02e83c0.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/38.2a809ae1.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/39.31de0194.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/4.a86536d1.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/40.4a3cfcb7.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/41.db485265.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/42.8c4375ac.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/43.2f241bb5.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/44.43539973.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/45.619b76a6.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/46.00e17cc1.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/47.faf51fac.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/49.3410da74.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/5.d3ebdf21.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/50.647913c0.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/51.4990b428.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/52.85ff4209.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/53.7bbf915a.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/54.1fc8316d.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/55.374436d3.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/56.40ebbbe6.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/57.40d9cc46.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/58.37ab0bcf.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/59.8df2efac.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/6.637082cf.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/60.326b4bdd.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/61.449fcfe0.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/62.f05ac3d6.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/63.e1723f7e.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/64.5b9e17ef.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/65.52e8ce24.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/66.cbdf653b.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/67.522e5bfd.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/68.1c27735b.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/69.1f5624e9.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/7.43089f9d.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/70.49fd6b50.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/71.20acc429.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/72.715f4620.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/73.ac123d7d.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/74.59a869d0.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/75.772485ad.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/76.b887e73a.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/77.70e54ee3.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/78.2306c3e7.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/79.e01a6cd1.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/8.4c4cdaa7.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/80.c12fc82f.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/81.44ef90b7.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/82.ff3143a2.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/83.22084435.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/84.485c66f4.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/85.d8afef97.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/86.2ba55e96.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/87.d5642266.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/88.3ad1f8ac.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/89.e370d2fc.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/9.a0f31be6.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/90.2c039dfb.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/91.2c1dd586.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/92.571cd8ae.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/93.b88ae6f6.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/94.16000348.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/95.79a96428.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/96.c86f8cad.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/97.bc1d6c91.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/98.34c6a547.js"><link rel="prefetch" href="/vue-testing-handbook/assets/js/99.e1174558.js">
    <link rel="stylesheet" href="/vue-testing-handbook/assets/css/0.styles.99f2ca3b.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/vue-testing-handbook/ko/" class="home-link router-link-active"><!----> <span class="site-name">Vue 테스팅 핸드북</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Select language" class="dropdown-title"><span class="title">다른 언어로 보기</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/vuex-in-components-mutations-and-actions.html" class="nav-link">English</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/v3/vuex-in-components-mutations-and-actions.html" class="nav-link">v3</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/ja/vuex-in-components-mutations-and-actions.html" class="nav-link">日本語</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/ru/vuex-in-components-mutations-and-actions.html" class="nav-link">Русский (Vue.js 2)</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/v3/ru/vuex-in-components-mutations-and-actions.html" class="nav-link">Русский (Vue.js 3)</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/zh-CN/vuex-in-components-mutations-and-actions.html" class="nav-link">简体中文</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/ko/vuex-in-components-mutations-and-actions.html" class="nav-link router-link-exact-active router-link-active">한국어</a></li></ul></div></div> <a href="https://github.com/lmiller1990/vue-testing-handbook" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><a href="https://vuejs-course.com/" target="_blank"><img id="ad" src="https://raw.githubusercontent.com/lmiller1990/vue-testing-handbook/master/src/.vuepress/public/composition.png" alt="vuejs-course banner"></a> <br> <div class="info"><small>
    Hi! Get $10 off my
    <a href="https://vuejs-course.com/" target="_blank">new</a> <a href="https://vuejs-course.com/" target="_blank">course</a> <a href="https://vuejs-course.com/" target="_blank">on</a> <a href="https://vuejs-course.com/" target="_blank">Vue.js 3</a>,
    <a href="https://vuejs-course.com/" target="_blank">TypeScript and</a>,
    <a href="https://vuejs-course.com/" target="_blank">testing</a>,
    with the discount code VUEJS_COURSE_10_OFF.
    </small></div> <nav class="nav-links"><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Select language" class="dropdown-title"><span class="title">다른 언어로 보기</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/vuex-in-components-mutations-and-actions.html" class="nav-link">English</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/v3/vuex-in-components-mutations-and-actions.html" class="nav-link">v3</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/ja/vuex-in-components-mutations-and-actions.html" class="nav-link">日本語</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/ru/vuex-in-components-mutations-and-actions.html" class="nav-link">Русский (Vue.js 2)</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/v3/ru/vuex-in-components-mutations-and-actions.html" class="nav-link">Русский (Vue.js 3)</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/zh-CN/vuex-in-components-mutations-and-actions.html" class="nav-link">简体中文</a></li><li class="dropdown-item"><!----> <a href="/vue-testing-handbook/ko/vuex-in-components-mutations-and-actions.html" class="nav-link router-link-exact-active router-link-active">한국어</a></li></ul></div></div> <a href="https://github.com/lmiller1990/vue-testing-handbook" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav>  <ul class="sidebar-links"><li><a href="/vue-testing-handbook/ko/" class="sidebar-link">환영합니다</a></li><li><a href="/vue-testing-handbook/ko/setting-up-for-tdd.html" class="sidebar-link">TDD를 위한 설정하기</a></li><li><a href="/vue-testing-handbook/ko/rendering-a-component.html" class="sidebar-link">컴포넌트 렌더하기</a></li><li><a href="/vue-testing-handbook/ko/components-with-props.html" class="sidebar-link">props 테스트하기</a></li><li><a href="/vue-testing-handbook/ko/computed-properties.html" class="sidebar-link">computed 프로퍼티</a></li><li><a href="/vue-testing-handbook/ko/simulating-user-input.html" class="sidebar-link">사용자 입력 시연하기</a></li><li><a href="/vue-testing-handbook/ko/testing-emitted-events.html" class="sidebar-link">emitted 이벤트 테스트하기</a></li><li><a href="/vue-testing-handbook/ko/mocking-global-objects.html" class="sidebar-link">전역 객체 모킹하기</a></li><li><a href="/vue-testing-handbook/ko/stubbing-components.html" class="sidebar-link">컴포넌트 스터빙</a></li><li><a href="/vue-testing-handbook/ko/finding-elements-and-components.html" class="sidebar-link">엘리먼트와 컴포넌트 찾기</a></li><li><a href="/vue-testing-handbook/ko/testing-vuex.html" class="sidebar-link">Vuex 테스트하기</a></li><li><a href="/vue-testing-handbook/ko/vuex-mutations.html" class="sidebar-link">Vuex - 뮤테이션</a></li><li><a href="/vue-testing-handbook/ko/vuex-actions.html" class="sidebar-link">Vuex - 액션</a></li><li><a href="/vue-testing-handbook/ko/vuex-getters.html" class="sidebar-link">Vuex - 게터</a></li><li><a href="/vue-testing-handbook/ko/vuex-in-components.html" class="sidebar-link">컴포넌트 내에 있는 Vuex - $state와 게터</a></li><li><a href="/vue-testing-handbook/ko/vuex-in-components-mutations-and-actions.html" class="active sidebar-link">컴포넌트 내에 있는 Vuex - 뮤테이션과 액션</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vue-testing-handbook/ko/vuex-in-components-mutations-and-actions.html#뮤테이션과-액션" class="sidebar-link">뮤테이션과 액션</a></li><li class="sidebar-sub-header"><a href="/vue-testing-handbook/ko/vuex-in-components-mutations-and-actions.html#컴포넌트-생성하기" class="sidebar-link">컴포넌트 생성하기</a></li><li class="sidebar-sub-header"><a href="/vue-testing-handbook/ko/vuex-in-components-mutations-and-actions.html#실제-vuex-스토어로-테스트하기" class="sidebar-link">실제 Vuex 스토어로 테스트하기</a></li><li class="sidebar-sub-header"><a href="/vue-testing-handbook/ko/vuex-in-components-mutations-and-actions.html#mock-스토어를-사용해서-테스트하기" class="sidebar-link">mock 스토어를 사용해서 테스트하기</a></li><li class="sidebar-sub-header"><a href="/vue-testing-handbook/ko/vuex-in-components-mutations-and-actions.html#namespaced-액션-또는-뮤테이션-테스트하기" class="sidebar-link">Namespaced 액션(또는 뮤테이션) 테스트하기</a></li><li class="sidebar-sub-header"><a href="/vue-testing-handbook/ko/vuex-in-components-mutations-and-actions.html#결론" class="sidebar-link">결론</a></li></ul></li><li><a href="/vue-testing-handbook/ko/vue-router.html" class="sidebar-link">Vue 라우터</a></li><li><a href="/vue-testing-handbook/ko/composition-api.html" class="sidebar-link">컴포지션 API</a></li><li><a href="/vue-testing-handbook/ko/reducing-boilerplate-in-tests.html" class="sidebar-link">보일러플레이트 줄이기</a></li><li><a href="/vue-testing-handbook/ko/jest-mocking-modules.html" class="sidebar-link">Jest - 모듈 모킹하기</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h2 id="뮤테이션과-액션"><a href="#뮤테이션과-액션" class="header-anchor">#</a> 뮤테이션과 액션</h2> <p>이전 가이드에서는 <code>$store.state</code>와 <code>$store.getters</code>를 사용해서 컴포넌트를 테스트하는 일에 관해 얘기해 보았습니다. 양쪽 다 컴포넌트에 현재 상태(state)를 제공합니다. 컴포넌트가 올바르게 뮤테이션(mutation)을 커밋(commit) 하거나 액션(action)을 디스패치(dispatch) 하는지 어설트(assert) 할 때, 정말로 원하는 것은 <code>$store.commit</code>과 <code>$store.dispatch</code>가 올바른 핸들러(호출 할 뮤테이션이나 액션)과 페이로드(payload)로 호출되는지 어설트 하는 것입니다.</p> <p>이렇게 하기 위한 두 가지 방법이 있습니다. 첫 번째 방법은 <code>createLocalVue</code>로 진짜 Vuex 스토어(store)를 사용하는 것이고, 또 다른 방법은 mock 스토어를 사용하는 것입니다. 두 테크닉 모두 <a href="https://lmiller1990.github.io/vue-testing-handbook/vuex-in-components.html" target="_blank" rel="noopener noreferrer">여기<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>에 설명되어 있습니다. 이 두 테크닉을 뮤테이션과 액션의 맥락에서 다시 보겠습니다.</p> <p>이 페이지에서 설명한 테스트의 소스 코드는 <a href="https://github.com/lmiller1990/vue-testing-handbook/tree/master/demo-app/tests/unit/ComponentWithButtons.spec.js" target="_blank" rel="noopener noreferrer">여기<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>에서 찾을 수 있습니다.</p> <h2 id="컴포넌트-생성하기"><a href="#컴포넌트-생성하기" class="header-anchor">#</a> 컴포넌트 생성하기</h2> <p>이 예제를 위해서, <code>&lt;ComponentWithButtons&gt;</code> 컴포넌트를 테스트하겠습니다.</p> <div class="language-vue extra-class"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> 
      <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>commit<span class="token punctuation">&quot;</span></span> 
      <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>handleCommit<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
      Commit
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">&gt;</span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> 
      <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>dispatch<span class="token punctuation">&quot;</span></span> 
      <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>handleDispatch<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
      Dispatch
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">&gt;</span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> 
      <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>namespaced-dispatch<span class="token punctuation">&quot;</span></span> 
      <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>handleNamespacedDispatch<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
      Namespaced Dispatch
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">&gt;</span></span>

<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span><span class="token script"><span class="token language-javascript">
<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  name<span class="token punctuation">:</span> <span class="token string">&quot;ComponentWithButtons&quot;</span><span class="token punctuation">,</span>

  methods<span class="token punctuation">:</span> <span class="token punctuation">{</span>
    <span class="token function">handleCommit</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>$store<span class="token punctuation">.</span><span class="token function">commit</span><span class="token punctuation">(</span><span class="token string">&quot;testMutation&quot;</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> msg<span class="token punctuation">:</span> <span class="token string">&quot;Test Commit&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token function">handleDispatch</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>$store<span class="token punctuation">.</span><span class="token function">dispatch</span><span class="token punctuation">(</span><span class="token string">&quot;testAction&quot;</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> msg<span class="token punctuation">:</span> <span class="token string">&quot;Test Dispatch&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>

    <span class="token function">handleNamespacedDispatch</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>$store<span class="token punctuation">.</span><span class="token function">dispatch</span><span class="token punctuation">(</span><span class="token string">&quot;namespaced/very/deeply/testAction&quot;</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> msg<span class="token punctuation">:</span> <span class="token string">&quot;Test Namespaced Dispatch&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>
</code></pre></div><h2 id="실제-vuex-스토어로-테스트하기"><a href="#실제-vuex-스토어로-테스트하기" class="header-anchor">#</a> 실제 Vuex 스토어로 테스트하기</h2> <p>먼저 뮤테이션을 위한 테스트로 <code>ComponentWithButtons.spec.js</code>를 작성해보겠습니다. 아래에 있는 두 가지 내용을 확인하길 원한다는 사실을 기억하세요.</p> <ol><li>정확한 뮤테이션을 커밋했는지?</li> <li>페이로드가 정확했는지?</li></ol> <p>전역 Vue 인스턴스(instance)를 오염시키는 일을 피하고자 <code>createLocalVue</code>를 사용하겠습니다.</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">import</span> Vuex <span class="token keyword">from</span> <span class="token string">&quot;vuex&quot;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> createLocalVue<span class="token punctuation">,</span> shallowMount <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&quot;@vue/test-utils&quot;</span>
<span class="token keyword">import</span> ComponentWithButtons <span class="token keyword">from</span> <span class="token string">&quot;@/components/ComponentWithButtons.vue&quot;</span>

<span class="token keyword">const</span> localVue <span class="token operator">=</span> <span class="token function">createLocalVue</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
localVue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>Vuex<span class="token punctuation">)</span>

<span class="token keyword">const</span> mutations <span class="token operator">=</span> <span class="token punctuation">{</span>
  testMutation<span class="token punctuation">:</span> jest<span class="token punctuation">.</span><span class="token function">fn</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>

<span class="token keyword">const</span> store <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Vuex<span class="token punctuation">.</span>Store</span><span class="token punctuation">(</span><span class="token punctuation">{</span> mutations <span class="token punctuation">}</span><span class="token punctuation">)</span>

<span class="token function">describe</span><span class="token punctuation">(</span><span class="token string">&quot;ComponentWithButtons&quot;</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>

  <span class="token function">it</span><span class="token punctuation">(</span><span class="token string">&quot;버튼을 클릭했을 때 뮤테이션을 커밋한다&quot;</span><span class="token punctuation">,</span> <span class="token keyword">async</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword">const</span> wrapper <span class="token operator">=</span> <span class="token function">shallowMount</span><span class="token punctuation">(</span>ComponentWithButtons<span class="token punctuation">,</span> <span class="token punctuation">{</span>
      store<span class="token punctuation">,</span> localVue
    <span class="token punctuation">}</span><span class="token punctuation">)</span>

    wrapper<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token string">&quot;.commit&quot;</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">trigger</span><span class="token punctuation">(</span><span class="token string">&quot;click&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">await</span> wrapper<span class="token punctuation">.</span>vm<span class="token punctuation">.</span><span class="token function">$nextTick</span><span class="token punctuation">(</span><span class="token punctuation">)</span>    

    <span class="token function">expect</span><span class="token punctuation">(</span>mutations<span class="token punctuation">.</span>testMutation<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">toHaveBeenCalledWith</span><span class="token punctuation">(</span>
      <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> msg<span class="token punctuation">:</span> <span class="token string">&quot;Test Commit&quot;</span> <span class="token punctuation">}</span>
    <span class="token punctuation">)</span>
  <span class="token punctuation">}</span><span class="token punctuation">)</span>

<span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre></div><p>테스트에 <code>await</code>을 표시하고 <code>nextTick</code>을 호출한 것을 주목하세요. 그 이유에 대한 자세한 설명은 <a href="https://lmiller1990.github.io/vue-testing-handbook/simulating-user-input.html#writing-the-test" target="_blank" rel="noopener noreferrer">여기<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>에서 볼 수 있습니다.</p> <p>어떤 흥미로운 일이 일어나고 있지는 않지만, 위 테스트에는 꽤 많은 코드가 있습니다. <code>localVue</code>를 생성하고 Vuex를 사용하겠습니다. 그러고 나서 스토어를 생성하고 <code>testMutation</code>에 Jest mock 함수 (<code>jest.fn()</code>)를 넘기겠습니다. Vuex 뮤테이션은 항상 두 개의 인자와 함께 호출됩니다. 첫 번째 인자는 현재의 상태고, 두 번째 인자는 페이로드입니다. 스토어를 위한 어떤 상태도 명시하지 않았기 때문에, 빈 객체와 함께 호출될 것이라고 예상할 수 있습니다. 두 번째 인자는 <code>{ msg: &quot;Test Commit&quot; }</code>가 예상되고, 컴포넌트 내에서 하드코딩 됩니다.</p> <p>이 테스트를 작성하는 데 있어서 많은 보일러플레이트(boilerplate) 코드가 있습니다만, 컴포넌트가 정확하게 행동하고 있는지 검증하는데 유효한 방법입니다. 더 적은 코드를 요구하는 또 다른 대안은 mock 스토어를 사용하는 것입니다. <code>testAction</code>이 디스패치 됐는지 어설트 하는 테스트를 작성하면서 그 방법에 대해 알아보겠습니다.</p> <h2 id="mock-스토어를-사용해서-테스트하기"><a href="#mock-스토어를-사용해서-테스트하기" class="header-anchor">#</a> mock 스토어를 사용해서 테스트하기</h2> <p>코드를 보고 나서, 이전 테스트와 비교하고 대조해보겠습니다. 아래의 두 가지 내용을 검증하고 싶다는 것을 기억해주세요.</p> <ol><li>정확한 액션이 디스패치 됐다</li> <li>페이로드가 정확하다</li></ol> <div class="language-js extra-class"><pre class="language-js"><code><span class="token function">it</span><span class="token punctuation">(</span><span class="token string">&quot;버튼을 클릭했을 때 액션을 디스패치 한다&quot;</span><span class="token punctuation">,</span> <span class="token keyword">async</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
  <span class="token keyword">const</span> mockStore <span class="token operator">=</span> <span class="token punctuation">{</span> dispatch<span class="token punctuation">:</span> jest<span class="token punctuation">.</span><span class="token function">fn</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">}</span>
  <span class="token keyword">const</span> wrapper <span class="token operator">=</span> <span class="token function">shallowMount</span><span class="token punctuation">(</span>ComponentWithButtons<span class="token punctuation">,</span> <span class="token punctuation">{</span>
    mocks<span class="token punctuation">:</span> <span class="token punctuation">{</span>
      $store<span class="token punctuation">:</span> mockStore 
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span><span class="token punctuation">)</span>

  wrapper<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token string">&quot;.dispatch&quot;</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">trigger</span><span class="token punctuation">(</span><span class="token string">&quot;click&quot;</span><span class="token punctuation">)</span>
  <span class="token keyword">await</span> wrapper<span class="token punctuation">.</span>vm<span class="token punctuation">.</span><span class="token function">$nextTick</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
  
  <span class="token function">expect</span><span class="token punctuation">(</span>mockStore<span class="token punctuation">.</span>dispatch<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">toHaveBeenCalledWith</span><span class="token punctuation">(</span>
    <span class="token string">&quot;testAction&quot;</span> <span class="token punctuation">,</span> <span class="token punctuation">{</span> msg<span class="token punctuation">:</span> <span class="token string">&quot;Test Dispatch&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre></div><p>이 테스트는 이전 예제보다 조금 더 간결합니다. <code>localVue</code>도 없고, <code>Vuex</code>도 없습니다. 이전에 <code>testMutation = jest.fn()</code>이라고 정의했던 함수를 모킹(mocking)하는 대신에, 실제로 <code>dispatch</code> 함수를 스스로 mock 합니다. <code>$store.dispatch</code>는 단지 일반적인 자바스크립트 함수이기 때문에, 이렇게 하는게 가능합니다. 그러고 나서 첫 번째 인자인 <code>testAction</code>이 올바른 액션 핸들러인지, 두 번째 인자인 페이로드가 정확한지 어설트 합니다. 액션이 실제로 어떤 일을 하는지는 신경 쓰지 않습니다. 이 부분은 별개로 테스트할 수 있습니다. 이 테스트의 목표는 간단하게 버튼을 클릭했을 때 페이로드와 함께 정확한 액션을 디스패치 하는지 확인하는 것입니다.</p> <p>실제 스토어나 mock 스토어를 사용할지 말지는 테스트를 작성하는 여러분의 개인적인 선호에 달려있습니다. 양쪽 다 옳은 방법입니다. 중요한 것은 여러분의 컴포넌트를 테스트하고 있다는 점입니다.</p> <h2 id="namespaced-액션-또는-뮤테이션-테스트하기"><a href="#namespaced-액션-또는-뮤테이션-테스트하기" class="header-anchor">#</a> Namespaced 액션(또는 뮤테이션) 테스트하기</h2> <p>세 번째이자 마지막 예제는 또 다른 방법을 보여줍니다. 액션이 올바른 인자와 함께 디스패치 됐는지 (또는 뮤테이션이 커밋됐는지) 테스트하는 방법입니다. 이 방법은 위에서 얘기한 두 개의 테크닉(실제 <code>Vuex</code> 스토어, 그리고 mock된 <code>dispatch</code> 메서드)를 결합한 방법입니다.</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token function">it</span><span class="token punctuation">(</span><span class="token string">&quot;버튼을 클릭했을 때 namespaced 액션을 디스패치한다&quot;</span><span class="token punctuation">,</span> <span class="token keyword">async</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
  <span class="token keyword">const</span> store <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Vuex<span class="token punctuation">.</span>Store</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
  store<span class="token punctuation">.</span>dispatch <span class="token operator">=</span> jest<span class="token punctuation">.</span><span class="token function">fn</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

  <span class="token keyword">const</span> wrapper <span class="token operator">=</span> <span class="token function">shallowMount</span><span class="token punctuation">(</span>ComponentWithButtons<span class="token punctuation">,</span> <span class="token punctuation">{</span>
    store<span class="token punctuation">,</span> localVue
  <span class="token punctuation">}</span><span class="token punctuation">)</span>

  wrapper<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token string">&quot;.namespaced-dispatch&quot;</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">trigger</span><span class="token punctuation">(</span><span class="token string">&quot;click&quot;</span><span class="token punctuation">)</span>
  <span class="token keyword">await</span> wrapper<span class="token punctuation">.</span>vm<span class="token punctuation">.</span><span class="token function">$nextTick</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

  <span class="token function">expect</span><span class="token punctuation">(</span>store<span class="token punctuation">.</span>dispatch<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">toHaveBeenCalledWith</span><span class="token punctuation">(</span>
    <span class="token string">'namespaced/very/deeply/testAction'</span><span class="token punctuation">,</span>
    <span class="token punctuation">{</span> msg<span class="token punctuation">:</span> <span class="token string">&quot;Test Namespaced Dispatch&quot;</span> <span class="token punctuation">}</span>
  <span class="token punctuation">)</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre></div><p>관심이 있는 모듈로 Vuex 스토어를 생성하면서 시작합니다. 테스트 내부에 <code>namespacedModule</code>이라는 모듈을 선언합니다. 하지만 실제 앱에서는 컴포넌트에서 의존하고 있는 모듈을 추출하면 됩니다. 그러고 나서 <code>dispatch</code> 메서드를 <code>jest.fn</code> mock으로 대체하고 이것에 대한 어설션을 만듭니다.</p> <h2 id="결론"><a href="#결론" class="header-anchor">#</a> 결론</h2> <p>이 섹션에서 다룬 내용은 아래와 같습니다.</p> <ol><li><code>localVue</code>로 Vuex를 사용하고 뮤테이션 모킹하기</li> <li>Vuex API (<code>dispatch</code>와 <code>commit</code>)을 모킹하기</li> <li>mock <code>dispatch</code> 함수로 실제 Vuex 스토어 사용하기</li></ol> <p>이 페이지에서 설명한 테스트의 소스코드는 <a href="https://github.com/lmiller1990/vue-testing-handbook/tree/master/demo-app/tests/unit/ComponentWithButtons.spec.js" target="_blank" rel="noopener noreferrer">여기<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>에서 찾을 수 있습니다.</p></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/lmiller1990/vue-testing-handbook/edit/master/ko/vuex-in-components-mutations-and-actions.md" target="_blank" rel="noopener noreferrer">Github에서 이 페이지 수정하기</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <div class="last-updated"><span class="prefix">마지막 업데이트:</span> <span class="time">2020. 1. 27. 오후 6:02:09</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/vue-testing-handbook/ko/vuex-in-components.html" class="prev">컴포넌트 내에 있는 Vuex - $state와 게터</a></span> <span class="next"><a href="/vue-testing-handbook/ko/vue-router.html">Vue 라우터</a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/vue-testing-handbook/assets/js/app.14051834.js" defer></script><script src="/vue-testing-handbook/assets/js/3.119a321e.js" defer></script><script src="/vue-testing-handbook/assets/js/2.94957ecd.js" defer></script><script src="/vue-testing-handbook/assets/js/48.840de9e5.js" defer></script>
  </body>
</html>
